//
//  WATFInterView.swift
//  WiFiFaster
//
//  Created by one on 2023/12/29.
//

import UIKit

class WATFInterView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        addSubview(watf_bgView)
        addSubview(watf_iconView)
        addSubview(watf_titleLabel)
        addSubview(watf_decLabel)
        addSubview(watf_nextButton)
        addSubview(watf_nextView)
        watf_bgView.snp.makeConstraints { make in
            make.top.left.width.equalToSuperview()
            make.height.equalTo(356)
        }
        watf_iconView.snp.makeConstraints { make in
            make.size.equalTo(CGSize(width: 160, height: 130))
            make.centerX.equalToSuperview()
            make.top.equalToSuperview().offset(102)
        }
        watf_titleLabel.snp.makeConstraints { make in
            make.centerX.equalToSuperview()
            make.top.equalTo(watf_iconView.snp.bottom).offset(22)
        }
        watf_decLabel.snp.makeConstraints { make in
            make.centerX.equalToSuperview()
            make.top.equalTo(watf_titleLabel.snp.bottom).offset(8)
        }
        watf_nextButton.snp.makeConstraints { make in
            make.size.equalTo(CGSize(width: 274, height: 58))
            make.centerX.equalToSuperview()
            make.top.equalTo(watf_bgView.snp.bottom).offset(42)
        }
        watf_nextView.snp.makeConstraints { make in
            make.size.equalTo(CGSize(width: 101, height: 49))
            make.left.equalTo(watf_nextButton.snp.left).offset(-15)
            make.top.equalTo(watf_bgView.snp.bottom).offset(16)
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    //MARK: - watf lazy
    lazy var watf_bgView: UIImageView = {
        let watf_bgView = UIImageView(image: UIImage(named: "watf_result_interBg"))
        return watf_bgView
    }()
    lazy var watf_iconView: UIImageView = {
        let watf_iconView = UIImageView(image: UIImage(named: "watf_result_inter"))
        watf_iconView.contentMode = .scaleAspectFit
        return watf_iconView
    }()
    lazy var watf_titleLabel: UILabel = {
        let watf_titleLabel = UILabel()
        watf_titleLabel.textColor = .white
        watf_titleLabel.font = UIFont.systemFont(ofSize: 24)
        watf_titleLabel.text = "Completed"
        return watf_titleLabel
    }()
    lazy var watf_decLabel: UILabel = {
        let watf_decLabel = UILabel()
        watf_decLabel.textColor = .white
        watf_decLabel.font = UIFont.systemFont(ofSize: 16)
        watf_decLabel.text = "Your internet speed has increased！"
        return watf_decLabel
    }()
    lazy var watf_nextButton: UIButton = {
        let watf_nextButton = UIButton()
        watf_nextButton.setBackgroundImage(UIImage(named: "watf_result_interBtn"), for: .normal)
        watf_nextButton.setTitle("Clear idle processes", for: .normal)
        watf_nextButton.setTitleColor(.white, for: .normal)
        watf_nextButton.titleLabel?.font = UIFont.systemFont(ofSize: 20)
        return watf_nextButton
    }()
    lazy var watf_nextView: UIImageView = {
        let watf_nextView = UIImageView(image: UIImage(named: "watf_result_next"))
        return watf_nextView
    }()
}
